package collection;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ArrayToListDemo {
    public static void main(String[] args) {
        String[] array1 = {"one","two","three","four","five"};
        System.out.println("Array:"+ Arrays.toString(array1));
        List<String> list = Arrays.asList(array1);
        System.out.println("List:"+list);
        //对该集合的操作就是对原数组对应的操作
        list.set(1,"six");
        System.out.println("List:"+list);
        System.out.println("Array:"+Arrays.toString(array1));
        List list2 = new ArrayList(list);

        System.out.println("list2:"+list2);
        list2.add("seven");
        System.out.println("list2:"+list2);

    }

}
